<template>
  <div class="child">
    <h3>子组件1(哥哥)</h3>
    <h4>玩具:{{ toy }}</h4>
    <button @click="emitter.emit('send-toy', toy)">给弟弟玩具</button>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import emitter from "../../utils/emitter";
let toy = ref("暴龙战士");
</script>

<style scoped>
.child {
  background: skyblue;
  padding: 10px;
  box-shadow: 0 0 10px black;
  border-radius: 10px;
}
</style>
